package com.example.springioc.model;

import lombok.*;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@ToString
@Component("u1")
@Setter @Getter
@AllArgsConstructor
@NoArgsConstructor
public class User {
    private Integer userId;
    private String userName;

    @Bean({"gU1_1", "gU1_2"})
    public User getUser1() {
        return new User(1, "zhangsan");
    }

//    @Primary
    @Bean
    public User getUser2() {
        return new User(2, "lisi");
    }
}
